README for Philips, Andrew Q. "How to Avoid Incorrect Inference (While Gaining Correct Ones) in Dynamic Models". Forthcoming at Political Science Research and Methods.

Last updated: February 13, 2021

Summary and notes: 
	-Below, all figures/tables in the main document and SI are listed, as well as the corresponding script needed to produce them. 
	-Scripts are listed below, as well as the files they produce. All scripts also have the figures they produce (in order) listed at the top of the script. 
	-Log files have also been created for all scripts. 
	-Note that there are no data needed for this replication; all results come from Monte Carlos which you can replicate using the scripts below
	-Note that any "yI0-xI0" files take a long time to run
	-"create-logs-figs.R" is a master file that creates all logs and figures for all but the .do file.

------ SCRIPTS -------------
* create-logs-figs.R: creates all log files and runs all R scripts below
* yI0-xI0.R: Figures 1, 2 (main document), 1, 2, 3, 5, 4, 6 (SI)
* yI0-xI1.R: Figures 3 (main document), 7, 8, 9 (SI)
* yI1-xI0.R: Figures 4 (main document), 10, 11, 12 (SI)
* yI1-xI1.R: Figures 5 (main document), 13, 14, 15 (SI)
* type2-stationary.R: Figures 21, 22 (SI), 6 (main document), 16, 17, 18, 19, 20 (SI)
* type2-cointegrating.R: Figures 28, 29 (SI), 7 (main document), 23, 24, 25, 26, 27 (SI)
* SI-tables.do: Tables 1, 2 (SI)
* yI0-xI0-EMWproposal.R: FIgure 30 (SI)
* yI0-xI1-EMWproposal.R: Figure 31 (SI)
* yI1-xI0-EMWproposal.R: Figure 32 (SI)
* yI1-xI1-EMWproposal.R: Figure 33 (SI)
* yI0-xI0-related-EMWproposal.R: Figures 34, 35 (SI)
* yI0-xI0-related-2iv-EMWproposal.R: Figures 36, 37 (SI)
* yI1-xI1-related-EMWproposal.R: Figure 38 (SI)
* yI1-xI1-related-2iv-EMWproposal.R: Figure 39 (SI)

------ LOG FILES -------------

* log-yI0-xI0.R.txt: log for yI0-xI0.R
* log-yI0-xI1.R.txt: log for yI0-xI1.R
* log-yI1-xI0.R.txt: log for yI1-xI0.R
* log-yI1-xI1.R.txt: log for yI1-xI1.R
* log-type2-stationary.R.txt: log for type2-stationary.R
* log-type2-cointegrating.R.txt: log for type2-cointegrating.R
* log-SI-tables.do.smcl: log for SI-tables.do
* log-yI0-xI0-EMWproposal.R.txt: log for yI0-xI0-EMWproposal.R
* log-yI0-xI1-EMWproposal.R.txt: log for yI0-xI1-EMWproposal.R
* log-yI1-xI0-EMWproposal.R.txt: log for yI1-xI0-EMWproposal.R
* log-yI1-xI1-EMWproposal.R.txt: log for yI1-xI1-EMWproposal.R
* log-yI0-xI0-related-EMWproposal.R.txt: log for yI0-xI0-related-EMWproposal.R
* log-yI0-xI0-related-2iv-EMWproposal.R.txt: log for yI0-xI0-related-2iv-EMWproposal.R
* log-yI1-xI1-related-EMWproposal.R.txt: log for yI1-xI1-related-EMWproposal.R
* log-yI1-xI1-related-2iv-EMWproposal.R.txt: log for yI1-xI1-related-2iv-EMWproposal.R

------ MAIN DOCUMENT -------------

* Figure 1: "yi0-xi0-SR.pdf", Short-Run Type I Error, $Y_t\sim I(0)$, $X_t\sim I(0)$. 
	Source: yI0-xI0.R

* Figure 2: "yi0-xi0-LR.pdf", Long-Run Type I Error, $Y_t\sim I(0)$, $X_t\sim I(0)$. 
	Source: yI0-xI0.R

* Figure 3: "yi0-xi1.pdf", Scenario II: $Y_t\sim I(0)$, $X_t\sim I(1)$. 
	Source: yI0-xI1.R

* Figure 4: "yi1-xi0.pdf", Scenario III: $Y_t\sim I(1)$, $X_t\sim I(0)$. 
	Source: yI1-xI0.R

* Figure 5: "yi1-xi1.pdf", Scenario IV: $Y_t\sim I(1)$, $X_t\sim I(1)$. 
	Source: yI1-xI1.R

* Figure 6: "yi0-xi0-stationary-rejecttruth.pdf", Scenario V: Rejection rates of the effects, $Y_t\sim I(0)$, $X_t\sim I(0)$ and are related. 
	Source: type2-stationary.R

* Figure 7: "yi1-xi1-coint-rejecttruth.pdf", Scenario VI: Rejection rates of the effects, $Y_t\sim I(1)$, $X_t\sim I(1)$ and are cointegrated. 
	Source: type2-cointegrating.R

----------- SI -------------

* Figure 1: "yi0-xi0-SR-evar5.pdf", Short-run Type I error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: yI0-xI0.R

* Figure 2: "yi0-xi0-LR-evar5.pdf", Long-run Type I error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$. 
	Source: yI0-xI0.R

* Figure 3: "yi0-xi0-SR-MSE.pdf", Short-run mean square error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 1$
	Source: yI0-xI0.R

* Figure 4: "yi0-xi0-SR-MSE-evar5.pdf", Short-run mean square error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: yI0-xI0.R

* Figure 5: "yi0-xi0-LR-MSE.pdf", Long-run median square error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 1$
	Source: yI0-xI0.R

* Figure 6: "yi0-xi0-LR-MSE-evar5.pdf", Long-run median square error, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: yI0-xI0.R

* Figure 7: "yi0-xi1-evar5.pdf", Scenario II: Rejection rates for $Y_t\sim I(0)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 5$
	Source: yI0-xI1.R

* Figure 8: "yi0-xi1-MSE.pdf", Scenario II: Mean (short-run) and median (long-run) square error for $Y_t\sim I(0)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 1$
	Source: yI0-xI1.R

* Figure 9: "yi0-xi1-MSE-evar5.pdf", Scenario II: Mean (short-run) and median (long-run) square error for $Y_t\sim I(0)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 5$
	Source: yI0-xI1.R

* Figure 10: "yi1-xi0-evar5.pdf", Scenario III: Rejection rates for $Y_t\sim I(1)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: yI1-xI0.R

* Figure 11: "yi1-xi0-MSE.pdf", Scenario III: Mean (short-run) and Median (long-run) square error for $Y_t\sim I(1)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 1$
	Source: yI1-xI0.R

* Figure 12: "yi1-xi0-MSE-evar5.pdf", Scenario III: Mean (short-run) and Median (long-run) square error for $Y_t\sim I(1)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source:	yI1-xI0.R

* Figure 13: "yi1-xi1-evar5.pdf", Scenario IV: Rejection rates for $Y_t\sim I(1)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 5$
	Source: yI1-xI1.R

* Figure 14: "yi1-xi1-mse-sr.pdf", Scenario IV: Mean squared error for short-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: yI1-xI1.R

* Figure 15: "yi1-xi1-mse-lr.pdf", Scenario IV: Median squared error for long-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: yI1-xI1.R

* Figure 16: "yi0-xi0-stationary-rejecttruth-evar5.pdf", Scenario V: Rejection rates of the effects, $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: type2-stationary.R

* Figure 17: "yi0-xi0-stationary-reject0.pdf", Scenario V: Power (rejection rates of zero) $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 1$
	Source: type2-stationary.R

* Figure 18: "yi0-xi0-stationary-reject0-evar5.pdf", Scenario V: Power (rejection rates of zero) $Y_t\sim I(0)$, $X_t\sim I(0)$ and $\sigma_\epsilon^2 = 5$
	Source: type2-stationary.R

* Figure 19: "yi0-xi0-stationary-mse-sr.pdf", Scenario V: Mean square error of the short-run effect, $Y_t\sim I(0)$, $X_t\sim I(0)$
	Source: type2-stationary.R

* Figure 20: "yi0-xi0-stationary-mse-lr.pdf", Scenario V: Median square error of the long-run effect, $Y_t\sim I(0)$, $X_t\sim I(0)$
	Source: type2-stationary.R

* Figure 21: "yi0-xi0-stationary-srboxplot.pdf", Scenario VI: Box-plots of the short-run effect, $Y_t\sim I(0)$, $X_t\sim I(0)$
	Source: type2-stationary.R

* Figure 22: "yi0-xi0-stationary-lrboxplot.pdf", Scenario VI: Box-plots of the long-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: type2-stationary.R

* Figure 23: "yi1-xi1-coint-rejecttruth-evar5.pdf", Scenario VI: Rejection rates of the effects, $Y_t\sim I(1)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 5$
	Source: type2-cointegrating.R

* Figure 24: "yi1-xi1-coint-reject0.pdf", Scenario VI: Power (rejection rates of zero) $Y_t\sim I(1)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 1$
	Source: type2-cointegrating.R

* Figure 25: "yi1-xi1-coint-reject0-evar5.pdf", Scenario VI: Power (rejection rates of zero) $Y_t\sim I(1)$, $X_t\sim I(1)$ and $\sigma_\epsilon^2 = 5$
	Source:	type2-cointegrating.R

* Figure 26: "yi1-xi1-coint-mse-sr.pdf", Scenario VI: Mean square error of the short-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: type2-cointegrating.R

* Figure 27: "yi1-xi1-coint-mse-lr.pdf", Scenario VI: Median square error of the long-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: type2-cointegrating.R

* Figure 28: "yi1-xi1-coint-srboxplot.pdf", Scenario VI: Box-plots of the short-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: type2-cointegrating.R

* Figure 29: "yi1-xi1-coint-lrboxplot.pdf", Scenario VI: Box-plots of the long-run effect, $Y_t\sim I(1)$, $X_t\sim I(1)$
	Source: type2-cointegrating.R

* Table 1: Simulated data with no short-run effect, ARDL(1,1)
	Source: SI-tables.do

* Table 2: Simulated data with no short-run effect, ECM
	Source: SI-tables.do

* Figure 30: "yi0-xi0-LRlxYES-EMWproposal.pdf", Scenario I: Long-run rejection rates, calculated \emph{only} if  $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant
	Source: yI0-xI0-EMWproposal.R

* Figure 31: "yi0-xi1-LRlxYES-EMWproposal.pdf", Scenario II: Long-run rejection rates, calculated \emph{only} if  $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant
	Source: yI0-xI1-EMWproposal.R

* Figure 32: "yi1-xi0-LRlxYES-EMWproposal.pdf", Scenario III: Long-run rejection rates, calculated \emph{only} if  $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant
	Source: yI1-xI0-EMWproposal.R

* Figure 33: "yi1-xi1-LRlxYES-EMWproposal.pdf", Scenario IV: Long-run rejection rates, calculated \emph{only} if  $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant
	Source: yI1-xI1-EMWproposal.R

* Figure 34: "yi0-xi0-related-evar1-emwproposal.pdf", Scenario V$_a$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant, $\sigma^2_y = 1$
	Source: yI0-xI0-related-EMWproposal.R

* Figure 35: "yi0-xi0-related-evar5-emwproposal.pdf", Scenario V$_a$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant, $\sigma^2_y = 5$
	Source: yI0-xI0-related-EMWproposal.R

* Figure 36: "yi0-xi0-related-2iv-evar1-emwproposal.pdf", Scenario V$_b$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant with additional regressor, $\sigma^2_y = 1$
	Source: yI0-xI0-related-2iv-EMWproposal.R

* Figure 37: "yi0-xi0-related-2iv-evar5-emwproposal.pdf", Scenario V$_b$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant with an additional regressor, $\sigma^2_y = 5$
	Source: yI0-xI0-related-2iv-EMWproposal.R

* Figure 38: "yi1-xi1-related-emwproposal.pdf", Scenario VI$_a$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant
	Source: yI1-xI1-related-EMWproposal.R

* Figure 39: "yi1-xi1-related-2iv-emwproposal.pdf", Scenario VI$_b$: Proportion of missed long-run effects if \emph{only} evaluating when $x_{t-1}$ (ARDL/ECM) or $x_{t}$ (LDV) is statistically significant with an additional regressor
	Source: yI1-xI1-related-2iv-EMWproposal.R

